﻿// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
#include "pch.h"
#include "DateTimeToStringConverter.h"

using namespace Weathr;

using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Globalization;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Interop;

Object^ DateTimeToStringConverter::Convert(Object^ value, TypeName targetType, Object^ parameter, String^ language)
{
    (void) targetType;	// Unused parameter
    (void) parameter;	// Unused parameter
    (void) language;	// Unused parameter

    auto dateTime = safe_cast<DateTime>(value);
    static Calendar^ calendar = ref new Calendar();
    calendar->SetDateTime(dateTime);
    return calendar->DayOfWeekAsString(0) + " " + calendar->DayAsString();
}

Object^ DateTimeToStringConverter::ConvertBack(Object^ value, TypeName targetType, Object^ parameter, String^ language)
{
    (void) value;
    (void) targetType;	// Unused parameter
    (void) parameter;	// Unused parameter
    (void) language;	// Unused parameter

    throw ref new NotImplementedException();
}
